var gulp = require('gulp');
var htmlmin = require('gulp-htmlmin');
var minifyCss = require('gulp-minify-css');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var concat = require('gulp-concat');
var less = require('gulp-less');
gulp.task('html',function(){
	/*gulp.src('*.html')
		.pipe(htmlmin(htmlmin({collapseWhitespace: true})))
		.pipe(gulp.dest(''))
	*/
})
gulp.task('css',function(){
	gulp.src('less/*.less')
		.pipe(concat('app.less'))
		.pipe(less())
		.pipe(minifyCss())
		.pipe(rename({
			basename:'app',
			suffix:'.min'
		}))
		.pipe(gulp.dest('css'))
})
gulp.task('js',function(){
	gulp.src('js/app.js')
		.pipe(uglify())
		.pipe(rename({
			suffix: ".min"
		}))
		.pipe(gulp.dest('js'))
})
gulp.task('watch',function(){
	gulp.watch(['less/*.less','js/*.js'],['html','css','js']);
})
gulp.task('default',['html','css','js','watch'])
